#ifndef _SPEED_DEF_H_
#define _SPEED_DEF_H_
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/crypto.h>
#include <linux/scatterlist.h>
#include <linux/string.h>
#include <linux/kthread.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/ktime.h>
#include <linux/random.h>
#include <linux/vmalloc.h>
#include <linux/timer.h>
#include <linux/completion.h>
#include <linux/list.h>
#include <linux/kobject.h>

#include <crypto/hash.h>
#include <crypto/skcipher.h>

#define MAX_ALG_NAME_LEN 64
#define MAX_THREADS 32
#define DEFAULT_TEST_TIME_MS 3000
#define DEFAULT_DATA_SIZE 1024
#define MAX_KEY_SIZE 32
#define MAX_IV_SIZE 16
#define MAX_DATA_SIZE (1024 * 1024) // 1MB
#define BATCH_SIZE 64

struct test_params {
	char alg_name[MAX_ALG_NAME_LEN];
	bool is_hash;
	int num_threads;
	int test_time_ms;
	int data_size;
	long total_ops;
	int key_size;
	int iv_size;
	u8 key[MAX_KEY_SIZE];
	u8 iv[MAX_IV_SIZE];
};

struct async_op_pool;
struct thread_data {
	struct task_struct *thread;
	struct completion completion;
	int thread_id;
	struct test_params *params;
	struct async_op_pool *op_pool; // 每个线程有自己的操作池
	ktime_t start_time;
	ktime_t end_time;
	u64 speed_mbps;
};

struct test_stats {
	struct thread_data threads[MAX_THREADS];
};

#endif // !_SPEED_DEF_H_
